//
//  ViewController.m
//  LHImagePicker
//
//  Created by 刘辉 lewis on 2018/6/13.
//  Copyright © 2018年 刘辉 lewis. All rights reserved.
//

#import "ViewController.h"
#import "LHImagePickerController.h"
@interface ViewController ()<LHImagePickerControllerDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
}
- (IBAction)photoBtnClick:(UIButton *)sender {
    LHImagePickerController*vc=[[LHImagePickerController alloc]init];
    vc.allowMaxSelectedImageCount=5;
    vc.delegate=self;
    UINavigationController*nav=[[UINavigationController alloc]initWithRootViewController:vc];
    [self presentViewController:nav animated:YES completion:^{
        
    }];
}

#pragma mark - LHImagePickerControllerDelegate
- (void)imagePickerController:(LHImagePickerController *)imagePicker didSelectAssets:(NSArray<PHAsset*>*)assets isSource:(BOOL)source{
    NSLog(@"用户选择的图片对象数组=%@",assets);
    [imagePicker dismissViewControllerAnimated:YES completion:^{
        
    }];
}
- (void)imagePickerControllerDidCancel:(LHImagePickerController *)imagePicker{
    NSLog(@"用户取消选择图片");
    [imagePicker dismissViewControllerAnimated:YES completion:^{
        
    }];
}

@end
